<g:javascript library="jquery"/>
<jq:plugin name="treeview"/>
<link rel="stylesheet" href="${createLinkTo(dir: 'css', file: 'jquery.treeview.css')}"/>
<script type="text/javascript">
    $(document).ready(function() {
        $("ul[id^='productTree']").treeview();
    });
</script>
<div id="treeview">
    <g:each in="${roots}" var="root" status="i">
        <ps:treeview root="${root}"
                childrenListName="sortedChildren"
                leafListName="sortedProducts"
                id="productTree${i}"
                class="filetree treeview-famfamfam"
                folderController="productCategory"
                fileController="product"
                folderAction="show"
                fileAction="show"/>
    </g:each>
</div>